#ifndef FIELD_H
#define FIELD_H
#include <vector>
#include "node.h"
namespace nav
{
#define OBSTICLE 65533

enum dirEncoded
{
    UP,
    UPL,
    L,
    LOWL,
    LOW,
    LOWR,
    R,
    UPR
};



class field
{
public:
    /** Default constructor */
    field(int sizeX, int sizeY);
    /** Default destructor */
    virtual ~field();
    int sizeX;
    int sizeY;

    //gets the Node at x y from the field
    nav::Node* getNodeAt(int x, int Y);
    //Make a maze
void    RandoMazeField(int nrOfSolids, int solidSize, int nrOfWalls, int wallSize, int playerX, int playerY, int targetX, int targetY);
    //Helperfunction for make a Maze
void    SetSquareObsticle(int xStart, int yStart, int xEnd, int yEnd,bool NoObsticle);
    //sets the Node at target x, y to Node
    void setNodeAt(int x, int y,  Node* NodeToSet);
    void setNodeWeight(int x, int y, int Weight);

    dirEncoded posToDir(int x, int y, int xx, int yy);
    void applyDistortion(dirEncoded direction, int distortion);
    std::vector<Node*> storage;

    void displayMap(int x, int y,int targetX, int targetY);
    int clamp(int val, int upLimit);

    void applyUPDistortion(int distortion);
    void applyUPRDistortion(int distortion) ;
    void applyUPLDistortion(int distortion) ;
    void applyLRDistortion(int distortion);
    std::vector<Node*> getNeighbours(Node* observedNode);
    char MapIntToChar(int mapVal, bool startCoord,bool targCoords,bool path);

    void resetDebugInfo();
protected:
private:


};
}
#endif // FIELD_H
